# 新增元素
dic1 = {
    'name':'zhangsan',
    'age':18
}
# dic1['gender'] = 'male'
# print(dic1)

# 修改元素
# dic1['gender'] = 'female'
# print(dic1)

# 删除元素
# age = dic1.pop('age')
# print(age)
# del dic1['age']
# print(dic1)

# 删除元素内的所有元素
# dic1.clear()
# print(dic1)

# 获取字典的所有的键
# print(list(dic1.keys()))

# 获取字典所有的值
# print(list(dic1.values()))

# 把字典dic2的数据更新到dic1中
dic2 = {
    'gender':'男'
}
dic1.update(dic2)
print(dic1)